/*LICENSE_BEGIN
 * ******************************************************************
 * Copyright 2006 by the Dainamite Robocup-Team at the
 * DAI-Labor, TU-Berlin (www.dai-labor.de)
 * 
 * Members of Dainamite are:
 * Holger Endert
 * Robert Wetzker
 * Thomas Karbe
 * Axel Heßler
 * Philippe Bütter
 * Felix Brossmann
 * 
 * Licensed under the GNU GPL (General Public License) Free Software 
 * License, Version 2. You may use this file only in compliance with 
 * the License. You may obtain a copy of the License at:
 * 
 * http://www.fsf.org/licensing/licenses/gpl.txt
 * ******************************************************************
LICENSE_END*/
package robocup.component.actions;

/**
 * PointToAction is used to let the arm of a player point to a certain
 * position. This is defined as distance and direction. Note, that the noise
 * of seeing this is very large.
 */
public class PointToAction extends Action {

	/**
	 * The distance to the position, which is pointed at.
	 */
	private double _dist;

	/**
	 * The direction to the position, which is pointed at.
	 */

	private double _dir;

	/**
	 * Constructor - am action which causes the agent to point his arm somewhere
	 * 
	 * @param dist
	 *            the distance of the point, to which the agent points to
	 * @param dir
	 *            the direction of the point, to which the agent points to
	 */
	public PointToAction(double dist, double dir) {
		this._dist = dist;
		this._dir = dir;
		this._type = TYPE.POINTTO;
	}

	/**
	 * Returns the actions string representation:
	 * @return 
	 * (pointto &lt;dist&gt; &lt;dir&gt;)<br><br>
	 */
	@Override
	public String toString() {
		StringBuffer buf = new StringBuffer();
		buf.append("(pointto ");
		buf.append((int) this._dist);
		buf.append(" ");
		buf.append((int) this._dir);
		buf.append(")");
		return buf.toString();
	}

	/**
	 * @return Returns the direction of this action.
	 */
	public double getDir() {
		return _dir;
	}

	/**
	 * @return Returns the distance of this action.
	 */
	public double getDist() {
		return _dist;
	}
}
